package me.zhengjie.modules.system.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.modules.system.domain.req.CheckRecordsReqDTO;
import me.zhengjie.modules.system.domain.req.CheckRecordsReqQueryDTO;
import me.zhengjie.modules.system.domain.rsp.CheckRecordsRspDTO;
import me.zhengjie.modules.system.service.CheckRecordsService;
import me.zhengjie.utils.PageResult;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author wx
 * @email
 * @date 2025-05-20 17:37:35
 */
@RestController
@RequestMapping("checkRecords")
@Api(tags = "校验记录")
public class CheckRecordsController {

    @Resource
    private CheckRecordsService checkRecordsService;

    /**
     * 列表
     */
    @ApiOperation(value = "列表")
    @PostMapping("/page")
    public PageResult<CheckRecordsRspDTO> page(@RequestBody CheckRecordsReqQueryDTO reqQueryDTO) {
        return checkRecordsService.findAll(reqQueryDTO);
    }

    /**
     * 保存
     */
    @ApiOperation(value = "保存")
    @PostMapping("/save")
    public ResponseEntity<Boolean> save(@RequestBody CheckRecordsReqDTO reqDTO) {
        checkRecordsService.save(reqDTO);
        return new ResponseEntity<>(HttpStatus.CREATED);
    }

}
